Skip to content

Release: merge dev into main#403

Merged
MDUYN merged 19 commits into
mainfrom
release/dev-to-main
Mar 20, 2026
Merged

Release: merge dev into main#403
MDUYN merged 19 commits into
mainfrom
release/dev-to-main

Conversation

@MDUYN
Copy link
Copy Markdown
Collaborator

@MDUYN MDUYN commented Mar 20, 2026

Release: dev → main

Merges all dev work into main, excluding squad/CI tooling.

Features

Bug Fixes

Documentation

  • Tasks — Rewrote with real Task API (time_unit/interval, @app.task() decorator, class-level attributes)
  • Trades — Documented actual Trade model and all Context methods
  • Deployment — Replaced generic content with real CLI commands (iaf init, iaf deploy-aws-lambda, iaf deploy-azure-function)

Tests

  • Uncommented and fixed 2 eventloop tests
  • Added tests for scheduling validation, net_gain bugs, trade metrics, CSV/CCXT data providers

Excluded from this PR

  • .squad/ files (dev-only team config)
  • Squad GitHub workflows
  • squad.config.ts
  • show_docs.sh

MDUYN added 19 commits March 18, 2026 15:53
Changed trades_average_gain_percentage → average_trade_gain_percentage
Changed trades_average_loss_percentage → average_trade_loss_percentage
…cs-keyerror

fix: KeyError in trade_metrics_table.py (#352)
Adds a new CCXTTickerDataProvider that handles DataType.TICKER data
sources using CCXT's fetch_ticker API. This resolves the 'No data
provider found' error when strategies request ticker data.

Changes:
- New CCXTTickerDataProvider class in infrastructure/data_providers/ccxt.py
- Registered as default data provider alongside CCXTOHLCVDataProvider
- Exported from all package __init__.py levels
- 15 unit tests with mocked CCXT calls

Closes #350
Replace the CI-only skip with a fully mocked CCXT exchange so the
download test reads from local CSV data in tests/resources/test_data/ohlcv
instead of making network calls.
…-data-provider

feat: add CCXTTickerDataProvider for TICKER data sources (#350)
…han data timeframe (#396)

- Add validation in TradingStrategy.__init__ that compares the strategy's
  scheduling interval (time_unit * interval) against the smallest OHLCV
  data source timeframe. Raises OperationalException with a descriptive
  message if the interval is too fast.
- Add 7 tests in tests/app/test_strategy_interval_validation.py covering
  all edge cases (faster, equal, slower, multiple sources, no sources,
  non-OHLCV sources, error message content).
- Fix test strategies in test_data_completeness.py that had invalid
  1-minute intervals with 1-day OHLCV data.
…nterval-faster-than-data-timeframe-396

feat: Warn or prevent scheduling interval faster than data timeframe (#396)
… by ~3x (#397)

Bug 1: In create_order_metadata_with_trade_context, the cost variable
accumulated across loop iterations but the entire accumulated value was
subtracted from each trade's revenue. With N trades, earlier costs were
subtracted N times instead of once, systematically understating net_gain.
Fix: use per-iteration trade_cost variable.

Bug 2: In _create_trade_metadata_with_sell_order_and_trades, net_gain
used sell_amount (total sell order) instead of trade_data['amount']
(per-trade portion), overcounting gain per trade when a sell order
was split across multiple trades. Fix: use trade_data['amount'].

Added 3 regression tests in tests/services/test_trade_service_net_gain.py.
…ests (#331)

- Add CSVTickerDataProvider class for ticker data from CSV files
- Export CSVTickerDataProvider at all package levels
- Add 19 new tests for CSVOHLCVDataProvider (has_data, get_data,
  backtest, edge cases, symbol/market/timeframe matching)
- Add 7 new tests for CSVTickerDataProvider (loading, has_data,
  get_data, symbol/market/data_type matching, custom identifier)
- Add new test data CSV files for backtesting scenarios
- Fix test_trade_price_update to use proper data fixtures
…derstatement-397

fix: Portfolio NAV snapshot understates total_net_gain by ~3x (#397)
…Is (#334)

- tasks.md: Replace fabricated examples with real Task class (time_unit/interval)
  and @app.task() decorator usage
- trades.md: Document actual Trade model attributes (opened_at, open_price,
  net_gain) and Context methods (get_trade, get_open_trades, add_stop_loss, etc.)
- deployment.md: Replace generic Docker/VPS content with real CLI commands
  (iaf init, iaf deploy-aws-lambda, iaf deploy-azure-function)
- Fix bug in app.py add_strategy() using non-existent worker_id instead of strategy_id
- Uncomment and fix 2 eventloop tests (test_initialize, test_get_data_sources_for_iteration)
- Update BacktestTradeOrderEvaluator constructor for new required params

Closes #334
- Fix prism-react-renderer import for Docusaurus 3.x compatibility
- Fix sidebar.js: replace missing doc IDs with actual files (data-sources, backtest_data)
- tasks.md: add class-level attribute pattern alongside constructor pattern
- Add show_docs.sh script for running docs locally (with --build option)
…es-deployment

docs: rewrite Tasks, Trades, and Deployment sections with accurate APIs
Includes all dev work since last release:
- feat: CSVTickerDataProvider and CCXTTickerDataProvider
- feat: scheduling interval vs data timeframe validation
- fix: portfolio net_gain accumulation bug
- fix: trade_metrics_table KeyError
- fix: app.py add_strategy() worker_id bug
- docs: rewrite Tasks, Trades, Deployment sections with accurate APIs
- fix: Docusaurus config and sidebar for v3 compatibility
- tests: eventloop tests uncommented, new test coverage

Excludes .squad/, squad workflows, and dev-only tooling.
@MDUYN MDUYN merged commit 640804e into main Mar 20, 2026
6 checks passed
@MDUYN MDUYN deleted the release/dev-to-main branch April 4, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant